﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LXD.StudnetMangement.Models
{
    public static class ModelBuilderExtensions
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Student>().HasData(
                   new Student
                   {
                       ID = 1,
                       Name = "杜兰特",
                       ClassName = ClassNameEnum.FirstGrade,
                       Email = "2823@ddxc.org",
                       Major = "小前锋"
                   },
                   new Student
                   {
                       ID = 2,
                       Name = "哈登",
                       ClassName = ClassNameEnum.SecondGrade,
                       Email = "Hardon@NBA.COM",
                       Major = "组织后卫"
                   },
                   new Student
                   {
                       ID = 3,
                       Name = "欧文",
                       ClassName = ClassNameEnum.SecondGrade,
                       Email = "IRAL@NBA.COM",
                       Major = "得分后卫"
                   }
               );
        }
    }
}
